<?php

class CSS{
	var $attributes = array();
	var $name ;
	var $value ;

	function CSS($name,$value){
		$this->name = $name ;
		$this->value = $value ;
		$matrix = split($value,";");
		for($i=0;$i<count($matrix);$i++){
			$p = split($matrix[$i],":");
			if(count($p) < 1){
				return ;
			}
			$this->setAttribute($p[0],$p[1]);
		}
	}

	function setAttribute($name,$value){
		$this->attributes[$name] = $value ;
	}

	function getAttribute($name){
		return $this->attributes[$name] ;
	}

	function getText(){
		$html  = "";
		$html .= $this->name ;
		$html .= "{";

		while(list($n,$v)=each($this->attributes)){
			$html .= $n . ":" . $v . ";" ;
		}
		$html .= "}";
	}

}

?>